<template>
	<view class="data_statistics_container">
		<view class="data_statistics_box">
			<view class="statistics_title_box">
				<image :src="titleImg" mode="widthFix" class="statistics_title_img"></image>
			</view>
			<view class="statistics_title">
				数据统计
			</view>
		</view>
		<view class="statistics_detail_box">
			<view class="statistics_detail_all" @click="handleChooseData('agentTodayOrder')">
				<view class="detail_title">
					今日订单
				</view>
				<view class="detail_num">
					{{dataObj.agentTodayOrder}}<span
						style="font-size: 24rpx; font-family: Source Han Sans CN; padding-left: 19rpx;">(单)</span>
				</view>
			</view>

			<view class="statistics_detail_all" @click="handleChooseData('agentTodayFaOrder')">
				<view class="detail_title">
					发货成功
				</view>
				<view class="detail_num">
					{{dataObj.agentTodayFaOrder}}<span
						style="font-size: 24rpx; font-family: Source Han Sans CN; padding-left: 19rpx;">(单)</span>
				</view>
			</view>

			<view class="statistics_detail_all" @click="handleChooseData('agentTodayYjRecord')">
				<view class="detail_title">
					今日佣金
				</view>
				<view class="detail_num">
					{{dataObj.agentTodayYjRecord}}<span
						style="font-size: 24rpx; font-family: Source Han Sans CN; padding-left: 19rpx;">(元)</span>
				</view>
			</view>

			<view class="statistics_detail_all" @click="handleChooseData('agentTodayNewAdd')">
				<view class="detail_title">
					新增分销
				</view>
				<view class="detail_num">
					{{dataObj.agentTodayNewAdd}}<span
						style="font-size: 24rpx; font-family: Source Han Sans CN; padding-left: 19rpx;">(个)</span>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['fxuserDataObj'],
		data() {
			return {
				titleImg: 'https://file-1314054542.cos.ap-shanghai.myqcloud.com/cos_file/wechat_xcx/6683708371466_1719890051.png',
				statisticsDetailList: [{
						title: '今日订单',
						count: 20,
						liftingNum: '-3'
					},
					{
						title: '发货成功',
						count: 60,
						liftingNum: '-3'
					},
					{
						title: '今日佣金',
						count: 120,
						liftingNum: '22'
					},
					{
						title: '新增分销',
						count: 220,
						liftingNum: '11'
					},
				],
				dataObj: {},
				userIsAgent: uni.getStorageSync('h5-isAgent')
			}
		},
		watch: {
			fxuserDataObj: {
				handler(newVal) {
					this.dataObj = newVal
				}
			}
		},
		methods: {
			// 点击数据统计
			handleChooseData(val) {
				if (val == 'agentTodayOrder') {
					uni.navigateTo({
						url: '/pages/my/dataStatisticsDetail/dataStatisticsDetail?type=' + val + '&countAll=' +
							this
							.dataObj.agentTodayOrder
					})
				} else if (val == 'agentTodayFaOrder') {
					uni.navigateTo({
						url: '/pages/my/dataStatisticsDetail/dataStatisticsDetail?type=' + val + '&countAll=' +
							this
							.dataObj.agentTodayFaOrder
					})
				} else if (val == 'agentTodayYjRecord') {
					uni.navigateTo({
						url: '/pages/my/dataCommission/dataCommission?type=' + val + '&countAll=' + this
							.dataObj.agentTodayYjRecord
					})
				} else if (val == 'agentTodayNewAdd') {
					uni.navigateTo({
						url: '/pages/my/dataDistribution/dataDistribution?type=' + val + '&countAll=' + this
							.dataObj.agentTodayNewAdd
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.data_statistics_container {
		background: #FFFFFF;
		box-shadow: 0px 12rpx 40rpx 17rpx rgba(172, 168, 168, 0.06);
		border-radius: 12rpx;
		border: 1px solid #F6F6F6;
		margin: 16rpx 16rpx 0;

		.data_statistics_box {
			position: relative;

			.statistics_title_box {
				width: 100%;

				.statistics_title_img {
					width: 100%;
					height: 100%;
				}
			}

			.statistics_title {
				position: absolute;
				top: 50%;
				left: 37rpx;
				transform: translateY(-50%);
				font-family: Source Han Sans CN;
				font-weight: 500;
				font-size: 34rpx;
				color: #333333;
			}
		}

		.statistics_detail_box {
			display: flex;
			justify-content: space-between;
			padding: 34rpx 25rpx 0 31rpx;

			.statistics_detail_all {
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.detail_title {
					font-family: Source Han Sans CN;
					font-weight: 400;
					font-size: 26rpx;
					color: #808080;
				}

				.detail_num {
					font-family: my-font;
					font-weight: bold;
					font-size: 38rpx;
					color: #333333;
					padding: 28rpx 0 26rpx;
				}

				.detail_lifting_box {
					display: flex;
					align-items: center;

					.lifting_title {
						font-family: Source Han Sans CN;
						font-weight: 400;
						font-size: 24rpx;
						color: #808080;
					}

					.lifting_num_up {
						font-family: my-font;
						font-weight: 400;
						font-size: 26rpx;
						color: #FF2B2B;
						padding: 0 7rpx 0 12rpx;
					}


					.lifting_num_down {
						font-family: my-font;
						font-weight: 400;
						font-size: 26rpx;
						color: #00C580;
						padding: 0 7rpx 0 12rpx;
					}

					.lifting_arrow_up {
						width: 0;
						height: 0;
						border-top: 0 solid transparent;
						border-right: 10rpx solid transparent;
						border-left: 10rpx solid transparent;
						border-bottom: 10rpx solid #FF2B2B;
					}

					.lifting_arrow_down {
						width: 0;
						height: 0;
						border-left: 10rpx solid transparent;
						border-right: 10rpx solid transparent;
						border-top: 10rpx solid #00C580;
					}
				}
			}
		}
	}
</style>